/*
* createWebHistory   --路由模式路径不带#号(生产环境下不能直接访问项目,需要nginx转发)
* createWebHashHistory　　----路由模式路径带#号
*/
import { createRouter, createWebHashHistory, RouteRecordRaw, createWebHistory } from 'vue-router'
import Layout from "@/views/layout/Layout.vue"
const routes: RouteRecordRaw[] = [
    {
        path: '/',
        redirect:'/login'
    },
    //登录页面
    {
        path: '/login',//路径名作为你跳转页面的唯一标识符
        component: () => import("@/views/login/Login.vue"),//组成部分 去哪这儿写vue 组件路径
    },
    
    //后台首页
    {
        path: "/home",
        component: Layout,
        meta: { title: '后台首页', path: "/home" },
        children: [{
            path: '/',
            name: "首页",
            component: () =>
                import ('@/views/home/Home.vue')

        }]
    },
     //全账号管理
     {
        path: '/acc',
        component: Layout,
        redirect: '/acc/manage',
        meta: { title: '全账号管理', path: "/acc" },
        children: [
            //账号列表
            {
                path: '/acc/manage',
                meta: { title: '账号管理', path: "/acc/manage" },
                component: () =>
                    import ('@/views/accountManagement/management/index.vue')
            },
            //账号添加
            {
                path: '/acc/acc-add',
                meta: { title: '账号添加', path: "/acc/acc-add" },
                component: () =>
                    import ('@/views/accountManagement/add/index.vue')
            }
           
        ]
    },
    //患者大数据
    {
        path: '/bigdata',
        component: Layout,
        redirect: '/bigdata/disease',
        meta: { title: '患者大数据', path: "/bigdata" },
        children: [
            //疾病大数据
            {
                path: '/bigdata/disease',
                meta: { title: '疾病大数据', path: "/bigdata/disease" },
                component: () =>
                    import ('@/views/bigData/disease/index.vue')
            },
            //药品耗材统计
            {
                path: '/bigdata/pharmaceutical',
                meta: { title: '药品耗材统计', path: "/bigdata/pharmaceutical" },
                component: () =>
                    import ('@/views/bigData/pharmaceutical/index.vue')
            }
           
        ]
    },
    //分级医生
    {
        path: '/doctor',
        component: Layout,
        redirect: '/doctor/list',
        meta: { title: '分级医生', path: "/doctor" },
        children: [
            //综合列表
            {
                path: '/doctor/list',
                meta: { title: '综合列表', path: "/doctor/list" },
                component: () =>
                    import ('@/views/doctor/list/index.vue')
            },
            //排班管理
            {
                path: '/doctor/scheduling',
                meta: { title: '排班管理', path: "/doctor/scheduling" },
                component: () =>
                    import ('@/views/doctor/scheduling/index.vue')
            },
            //修改个人信息
            {
                path: '/doctor/edit',
                meta: { title: '修改个人信息', path: "/doctor/edit" },
                component: () =>
                    import ('@/views/doctor/edit/index.vue')
            }
           
        ]
    },
     //分级护士
     {
        path: '/nurse',
        component: Layout,
        redirect: '/nurse/list',
        meta: { title: '分级医生', path: "/doctor" },
        children: [
            //综合列表
            {
                path: '/nurse/list',
                meta: { title: '综合列表', path: "/nurse/list" },
                component: () =>
                    import ('@/views/nurse/list/index.vue')
            },
            //排班管理
            {
                path: '/nurse/scheduling',
                meta: { title: '排班管理', path: "/nurse/scheduling" },
                component: () =>
                    import ('@/views/nurse/scheduling/index.vue')
            },
            //修改个人信息
            {
                path: '/nurse/edit',
                meta: { title: '修改个人信息', path: "/nurse/edit" },
                component: () =>
                    import ('@/views/nurse/edit/index.vue')
            }
           
        ]
    },
    //医院综合
    {
        path: '/comprehensive',
        component: Layout,
        redirect: '/comprehensive/manage',
        meta: { title: '医院综合', path: "/comprehensive" },
        children: [
            //科室管理
            {
                path: '/comprehensive/manage',
                meta: { title: '科室管理', path: "/comprehensive/manage" },
                component: () =>
                    import ('@/views/hospitalComprehensive/departmentManagement/index.vue')
            },
            //添加科室
            {
                path: '/comprehensive/add',
                meta: { title: '添加科室', path: "/comprehensive/add" },
                component: () =>
                    import ('@/views/hospitalComprehensive/departmentAdd/index.vue')
            }
        ]
    },
    //医疗前线
    {
        path: '/frontline',
        component: Layout,
        redirect: '/frontline/manage',
        meta: { title: '医疗前线', path: "/frontline" },
        children: [
            //处方管理
            {
                path: '/frontline/manage',
                meta: { title: '处方管理', path: "/frontline/manage" },
                component: () =>
                    import ('@/views/medicalFrontline/management/index.vue')
            },
            //处方开具
            {
                path: '/frontline/prescription',
                meta: { title: '处方开具', path: "/frontline/prescription" },
                component: () =>
                    import ('@/views/medicalFrontline/prescription/index.vue')
            }
           
        ]
    },
    //医疗药品出入库
    {
        path: '/warehouse',
        component: Layout,
        redirect: '/warehouse/manage',
        meta: { title: '医疗药品出入库', path: "/warehouse" },
        children: [
            //医疗用品综合管理
            {
                path: '/warehouse/manage',
                meta: { title: '医疗用品综合管理', path: "/warehouse/manage" },
                component: () =>
                    import ('@/views/medicalInWarehouse/management/index.vue')
            },
            //添加药品耗材
            {
                path: '/warehouse/add',
                meta: { title: '添加药品耗材', path: "/warehouse/add" },
                component: () =>
                    import ('@/views/medicalInWarehouse/medicalAdd/index.vue')
            }
           
        ]
    },
    //动态个人
    {
        path: '/personal',
        component: Layout,
        redirect: '/personal/registration',
        meta: { title: '全账号管理', path: "/personal" },
        children: [
            //挂号管理
            {
                path: '/personal/registration',
                meta: { title: '挂号管理', path: "/personal/registration" },
                component: () =>
                    import ('@/views/personal/registration/index.vue')
            }
           
        ]
    },
    //中西医药房
    {
        path: '/pharmacy',
        component: Layout,
        redirect: '/pharmacy/manage',
        meta: { title: '中西医药房', path: "/pharmacy" },
        children: [
            //营收数据表
            {
                path: '/pharmacy/revenue-data',
                meta: { title: '营收数据表', path: "/pharmacy/revenue-data" },
                component: () =>
                    import ('@/views/pharmacy/revenueData/index.vue')
            },
            //处方综合管理
            {
                path: '/pharmacy/manage',
                meta: { title: '处方综合管理', path: "/pharmacy/manage" },
                component: () =>
                    import ('@/views/pharmacy/management/index.vue')
            }
           
        ]
    },
     //病床管理
     {
        path: '/sickbed',
        component: Layout,
        redirect: '/sickbed/manage',
        meta: { title: '病床管理', path: "/sickbed" },
        children: [
            //添加床位
            {
                path: '/sickbed/bed-add',
                meta: { title: '添加床位', path: "/sickbed/bed-add" },
                component: () =>
                    import ('@/views/sickBed/bedAdd/index.vue')
            },
            //综合管理
            {
                path: '/sickbed/manage',
                meta: { title: '综合管理', path: "/sickbed/manage" },
                component: () =>
                    import ('@/views/sickBed/management/index.vue')
            }
           
        ]
    },
    {
        path: '/*',
        name: 'error404',
        component: () => import("@/views/error/Error.vue")
        
    }

]

const router = createRouter({
    history: createWebHistory(),
    routes,
})
export default router